home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / varia / egebook.lha / ege.book / 5 / TeachingAssistant.C < prev    next >
C/C++ Source or Header  |  1992-06-07  |  573b  |  29 lines

  1. #include <iostream.h>
  2.  
  3. #include "Collection.h"
  4. #include "TeachingAssistant.h"
  5.  
  6. Collection* TeachingAssistant::All = new Collection;
  7.  
  8. Example* TeachingAssistant::alike(String &name) {
  9.   return(new TeachingAssistant(name));
  10. };
  11.  
  12. void TeachingAssistant::maintain() {
  13.   String selection;
  14.   cout << "as teacher (t) or student (s): ";
  15.   cin >> selection;
  16.   if (selection.contains("t"))
  17.     Teacher::maintain();
  18.   else
  19.     Student::maintain();
  20. }
  21.  
  22. bool TeachingAssistant::add(Example *c) {
  23.   if (Teacher::add(c)) {
  24.     salary += 1000;
  25.     return TRUE;
  26.   } else
  27.     return FALSE;
  28. };
  29.